<!DOCTYPE html>
<html >

	<head>
		<meta charset="utf-8">
		<title>忘记密码</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="css/mui.css">
		<link rel="stylesheet" href="css/app.css">
        <link rel="stylesheet" href="css/weui.css">
  <script type="text/javascript" src="js/utile.js"></script>
  <script type="text/javascript" src="js/jquery-2.0.0.min.js"></script>
        <script type="text/javascript">
$(document).ready(function(){
  $(".passuser").mousedown(function(){
    $(this).css("border","1px solid #30a5ff");
  });
   $(".passuser").mouseout(function(){
    $(this).css("border","1px solid #c9c9c9");
  });
   
});

function modifyPassword(){
	var oldPassword =  $(".oldPassword").val();
	var newPassword =  $(".newPassword").val();
	var newPassword1 =  $(".newPassword1").val();
	if(newPassword != newPassword1){
		alert("输入的两次新密码不一致");
		return;
	}
	if(newPassword.length < 6 || newPassword.length > 10) {
		alert("新密码长度应大于6个字符不超过10个字符");
		return;
	}
	 var url = getURL() + "/mobile/user/modifyPassword";
	  var pram = {oldPassword: oldPassword, password: newPassword };
	  $.ajax({
		  type: 'POST',
		  url: url,
		  data: pram,
		  success: function(data){
			switch(data) {
			case 1:
				alert("密码修改成功");
				window.location.href = "login.html";
				break;
			case 3:
				alert("当前密码错误");
				break;
			case 0:
				alert("当前登陆状态没有卡号");
				break;
			case 2:
				alert("您的卡号不存在");
				break;
			}
		  },
		  dataType: "json"
		});
}
</script>
	</head>

	<body >

		<header id="header" class="mui-bar mui-bar-nav"> <a onclick="history.go(-1)" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="color:#fff;"></a>
  <h1 class="mui-title">修改密码</h1>
</header>


		<div class="container loginTop" style="width:80%;">
        <table width="100%">
        <tr>
        <td width="30%" class="passUserLabe">当前密码:</td>
        <td width="70%">  <input name="" type="password"  placeholder="请输入当前密码" class="passuser oldPassword" ></td>
        </tr>
         <tr>
        <td class="passUserLabe">新密码:</td>
        <td> <input name="" type="password"  placeholder="请输入新密码" class="passuser newPassword" ></td>
        </tr>
         <tr>
        <td class="passUserLabe">确认密码:</td>
        <td><input name="" type="password"  placeholder="请再次输入密码" class="passuser newPassword1" ></td>
        </tr>
        <tr  style="color:red; font-size:10px; text-align:center;"><td colspan="2">密码长度应大于6个字符不超过10个字符</td></tr>
        </table>
     
        <p></p>
       <div class="pt30"> 
       
         <a onclick="modifyPassword()" class="weui_btn weui_btn_plain_blue" style="font-size:16px;">保存</a></div>
        
		</div>
	

	</body>

</html>